package com.bhs.sansonglogistics.ui.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bhs.sansonglogistics.R;
import com.bhs.sansonglogistics.bean.ArriveBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class ArriveAdapter extends BaseQuickAdapter<ArriveBean, BaseViewHolder> {

    public ArriveAdapter(@Nullable List<ArriveBean> data) {
        super(R.layout.item_arrive, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, ArriveBean item) {
        helper.setText(R.id.tv_company_name, item.getOutlets_name());
        helper.setText(R.id.tv_address, item.getOutlets_address());
        helper.setText(R.id.tv_personal_information, String.format("%s %s", item.getOutlets_contact(), item.getOutlets_mobile()));
        helper.setImageResource(R.id.iv_status, item.isChecked() ? R.mipmap.ic_checked : R.mipmap.ic_unchecked);
    }
}
